<template>
  <mars-dialog :draggable="true" :height="300" title="连线相关" :width="380" :position="{ top: 60, left: 10 }">
    <a-space class="f-mb">
      <mars-button @click="drawLineBetweenOverlays">通信线（唯一）</mars-button>
      <mars-button @click="drawCommandLine">指挥线（唯一）</mars-button>
    </a-space>
    <a-space class="f-mb">
      <mars-button @click="drawLineBetweenOverlaysWithConstraint">有条件联线（id小联大）</mars-button>
    </a-space>
  </mars-dialog>
</template>

<script setup>
import * as mapWork from "./map.js"
import useLifecycle from "@/common/uses/use-lifecycle"

// 启用map.ts生命周期
useLifecycle(mapWork)
const drawLineBetweenOverlays = () => {
  mapWork.drawLineBetweenOverlays()
}

const drawCommandLine = () => {
  mapWork.drawCommandLine()
}

const drawLineBetweenOverlaysWithConstraint = () => {
  mapWork.drawLineBetweenOverlaysWithConstraint()
}
</script>

<style scoped lang="less"></style>
